﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//name:姚铁
//time:2017.9.5

namespace flow_control_switch
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入需要进行的算法【1-加法】【2-减法】【3-乘法】【4-除法】");
            int a = Convert.ToInt32(Console.ReadLine());
            switch (a){
                case 1:
                    Console.WriteLine("请输入数值进行加法计算");
                    int a1 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("+");
                    int a2 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("=" + (a1 + a2));
                    Console.ReadKey();
                    break;
                case 2:
                    Console.WriteLine("请输入数值进行减法计算");
                    int b1 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("-");
                    int b2 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("=" + (b1 - b2));
                    Console.ReadKey();
                    break;
                case 3:
                    Console.WriteLine("请输入数值进行乘法计算");
                    int c1 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("*");
                    int c2 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("=" + (c1 * c2));
                    Console.ReadKey();
                    break;
                case 4:
                    Console.WriteLine("请输入数值进行除法计算");
                    int d1 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("/");
                    int d2 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("=" + (d1 / d2));
                    Console.ReadKey();
                    break;
                default:
                    Console.WriteLine("输入错误");
                    break;
            }
        }
    }
}
